# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Blackleg <blacklg@openaliasbox.org>
# Contributor: Nidhogg
# Contributor: juantascon

pkgname=python-peewee
pkgver=3.16.3
pkgrel=1
pkgdesc="a little orm"
url="https://github.com/coleifer/peewee/"
arch=('loong64' 'x86_64')
license=('MIT')
depends=('python' 'sqlite')
optdepends=('python-psycopg2: for PostgreSQL database support'
            'python-pymysql: for MySQL database support')
makedepends=('python-build' 'python-installer' 'cython' 'python-setuptools' 'python-wheel')
checkdepends=('python-apsw' 'python-flask' 'python-psycopg2')
source=("$pkgname-$pkgver.tar.gz::https://github.com/coleifer/peewee/archive/$pkgver.tar.gz")
sha512sums=('e940c0fc78c736477b2550379912587f2129bf6c11252a04188a70d260410539ef90879dcf4145466c3276130b33c85b53db80afb5503b7b76693155d5f8abbe')

build() {
  cd peewee-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd peewee-$pkgver
  python runtests.py
}

package() {
  cd peewee-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
